<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.serviceprovider.business.utility.SecurityContextUser"%>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>

<head>
<title>Reports</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link  rel="stylesheet" href="<c:url value="/css/styles.css"/>"/>
<link  rel="stylesheet" href="<c:url value="/javascripts/jscalendar/theme/calendar-system.css"/>"/>
<script src="<c:url value="/javascripts/jscalendar/calendar-cfg.js"/>" ></script>
<script src="<c:url value="/javascripts/calendar.js"/>" ></script>
<script src="<c:url value="/javascripts/jscalendar/lang/calendar-en.js"/>" ></script>
<script src="<c:url value="/javascripts/jscalendar/calendar-setup.js"/>" ></script>

<script src="<c:url value="/javascripts/common.js"/>">
</script>
</head>
<body><div class="page">
<%
    Object isAdmin = SecurityContextUser.isAdmin();
    if(Boolean.TRUE.equals(isAdmin)){
        %>
            <%@include file="../../admin/top_menu.jsp"%>
        <%
    } else{
        %>
            <%@include file="../top_menu.jsp"%>
        <%
    }
    %>
<table width=100%>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>

</table>
<div class="contentArea">

	<c:import url="select_report.jsp" />
    <table border=0 cellpadding=4 cellspacing=1 width=100%>
        <thead>
            <tr><th colspan="9" class="table_title">All Payee Fees Report</th></tr>
        </thead>
        <tbody>

		<thead>
			<tr>
				<th rowspan="3">Ser</th>
				<th rowspan="3">SSN</th>
				<th rowspan="3">Customer Name</th>

			</tr>
            <tr>
            	<c:if test="${criteria.showPayee1Column}">
            		<th>Payee 1 Name</th>
            	</c:if>
                
            	<c:if test="${criteria.showPayee2Column}">
            		<th>Payee 2 Name</th>
            	</c:if>
            	
            	<c:if test="${criteria.showPayee3Column}">
            		<th>Payee 3 Name</th>
            	</c:if>
            	
            	<c:if test="${criteria.showPayee4Column}">
            		<th>Payee 4 Name</th>
            	</c:if>
            	
            	<th>Total</th>
            </tr>
         </thead>
                 
    <c:forEach var="batch" items="${reportData.batchRecords}">
    
		<thead>

            <tr>
            
            	<th></th>
            	<th></th>
            	<th></th>
            	
				<c:if test="${criteria.showSelfFeeColumn}">
					<th></th>
				</c:if>
				            
            	<c:if test="${criteria.showPayee1Column}">
                	<th>${batch.payee1Name}</th>
                </c:if>
                
                <c:if test="${criteria.showPayee2Column}">
                	<th>${batch.payee2Name}</th>
                </c:if>
                
                <c:if test="${criteria.showPayee3Column}">
                	<th>${batch.payee3Name}</th>
                </c:if>
                
                <c:if test="${criteria.showPayee4Column}">
                	<th>${batch.payee4Name}</th>
                </c:if>
                
                
            </tr>
		</thead>
		
		<tbody>
		<c:forEach var="record" items="${batch.records}" varStatus="i">
				<tr>
					<td>${i.index+1}</td>
					<td>${record.ssn}</td>
					<td>${record.customerName}</td>
					<c:if test="${criteria.showPayee1Column}">
                    	<td>${record.payee1fee}</td>
                    </c:if>
                    
                    <c:if test="${criteria.showPayee2Column}">
                    	<td>${record.payee2fee}</td>
                    </c:if>
                    
                    <c:if test="${criteria.showPayee3Column}">
                    	<td>${record.payee3fee}</td>
                    </c:if>
                    
                    <c:if test="${criteria.showPayee4Column}">
                    	<td>${record.payee4fee}</td>
                    </c:if>
                    
                    <td>${record.totalByRow}</td>
				</tr>
			</c:forEach>
	        <tr>
	        	<td colspan="8"><hr /></td>
	        </tr>
        </c:forEach>
        <tbody>
              <tr>
                <td colspan="3" class="totals">Totals: </td>                
                <c:if test="${criteria.showPayee1Column}">
                	<td class="totals">${reportData.payee1Totals}</td>
                </c:if>
                
                <c:if test="${criteria.showPayee2Column}">
                	<td class="totals">${reportData.payee2Totals}</td>
                </c:if>
                
                <c:if test="${criteria.showPayee3Column}">
                	<td class="totals">${reportData.payee3Totals}</td>
                </c:if>
                
                <c:if test="${criteria.showPayee4Column}">
                	<td class="totals">${reportData.payee4Totals}</td>
                </c:if>
            </tr>
            </tbody>
        </table>
</div></div>
<%@include file="/WEB-INF/jsp/include/footer.jsp"%></body>

</html>
